home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Grafik & Text & Film / Quark XTensions / Freeware Xtensions / XPress Scripts 1.0 / Print Selective Plates / Print Selective Plates next >
Text File  |  1994-08-10  |  6KB  |  141 lines

  1. tell application "QuarkXPress 3.3"
  2.     activate
  3.     if document 1 exists then
  4.         tell document 1
  5.             
  6.             copy (name of every color spec whose name is not "White" and name is not "Registration" and separation is false) to ColorName
  7.             copy (count of ColorName) to ColorNumber
  8.             copy ColorName as list to allPlatesList
  9.             copy {} as list to platesList
  10.             set docName to name
  11.             
  12.             copy (display dialog "Choose plates to print from:" & return & "'" & docName & ¬
  13.                 "'." buttons {"Cancel", "All plates", "Choose..."} default button 2 with icon 2000) to printDlog
  14.             do updates
  15.             
  16.             if button returned of printDlog is "All plates" then
  17.                 try
  18.                     set oldDelim to AppleScript's text item delimiters
  19.                     set AppleScript's text item delimiters to {", "}
  20.                     copy index of current page to currentPage
  21.                     copy number of pages of current spread as list to pagesOfSpread
  22.                     copy index of every page of current spread as list to everypageOfSpread
  23.                     copy first item of everypageOfSpread to firstPageOfSpread
  24.                     copy last item of everypageOfSpread to lastPageOfSpread
  25.                     
  26.                     if print spreads of print setup is false then
  27.                         copy (display dialog "Print page with plates:" & return & allPlatesList & ¬
  28.                             "." buttons {"Cancel", " Page " & currentPage & " "} default button 2 with icon 2001) to x
  29.                         do updates
  30.                         if button returned of x is " Page " & currentPage & " " then
  31.                             tell current page
  32.                                 tell print setup
  33.                                     print copies (1) OPI (include images) cover page (no) paper source (paper cassette) plates (allPlatesList)
  34.                                 end tell
  35.                             end tell
  36.                         end if
  37.                     else if print spreads of print setup is true then
  38.                         if pagesOfSpread = {1} then
  39.                             copy (display dialog "Print spread with plates:" & return & allPlatesList & ¬
  40.                                 "." buttons {"Cancel", " Page " & currentPage & " "} default button 2 with icon 2001) to x
  41.                             do updates
  42.                             if button returned of x is " Page " & currentPage & " " then
  43.                                 tell current page
  44.                                     tell print setup
  45.                                         print copies (1) OPI (include images) cover page (no) paper source (paper cassette) plates (allPlatesList)
  46.                                     end tell
  47.                                 end tell
  48.                             end if
  49.                         else
  50.                             copy (display dialog ¬
  51.                                 "Print spread with plates:" & return & allPlatesList & ¬
  52.                                 "." buttons {"Cancel", "Pages " & firstPageOfSpread & "-" & lastPageOfSpread} default button 2 with icon 2001) to x
  53.                             do updates
  54.                             if button returned of x is "Pages " & firstPageOfSpread & "-" & lastPageOfSpread then
  55.                                 tell current spread
  56.                                     tell print setup
  57.                                         print copies (1) OPI (include images) cover page (no) paper source (paper cassette) plates (allPlatesList)
  58.                                     end tell
  59.                                 end tell
  60.                             end if
  61.                         end if
  62.                     end if
  63.                     set AppleScript's text item delimiters to oldDelim
  64.                 on error
  65.                     set AppleScript's text item delimiters to oldDelim
  66.                 end try
  67.                 
  68.             else if button returned of printDlog is "Choose..." then
  69.                 repeat with i from 1 to ColorNumber by 1
  70.                     copy (display dialog "Print '" & item i of ColorName & "' plate?" & return & " " buttons {"Cancel", "    Yes    ", "No"} default button 2 with icon 2001) to x
  71.                     do updates
  72.                     if button returned of x is "    Yes    " then
  73.                         copy platesList & item i of ColorName to platesList
  74.                     else if button returned of x is "No" then
  75.                         copy platesList to platesList
  76.                     end if
  77.                 end repeat
  78.                 
  79.                 if platesList = {} then
  80.                     display dialog "No plates selected." & return & " " buttons "OK" default button 1 with icon 1
  81.                     
  82.                 else
  83.                     try
  84.                         set oldDelim to AppleScript's text item delimiters
  85.                         set AppleScript's text item delimiters to {", "}
  86.                         copy index of current page to currentPage
  87.                         copy number of pages of current spread as list to pagesOfSpread
  88.                         copy index of every page of current spread as list to everypageOfSpread
  89.                         copy first item of everypageOfSpread to firstPageOfSpread
  90.                         copy last item of everypageOfSpread to lastPageOfSpread
  91.                         
  92.                         if print spreads of print setup is false then
  93.                             copy (display dialog "Print page with plates:" & return & platesList & ¬
  94.                                 "." buttons {"Cancel", " Page " & currentPage & " "} default button 2 with icon 2001) to x
  95.                             do updates
  96.                             if button returned of x is " Page " & currentPage & " " then
  97.                                 tell current page
  98.                                     tell print setup
  99.                                         print copies (1) OPI (include images) cover page (no) paper source (paper cassette) plates (platesList)
  100.                                     end tell
  101.                                 end tell
  102.                             end if
  103.                         else if print spreads of print setup is true then
  104.                             if pagesOfSpread = {1} then
  105.                                 copy (display dialog "Print spreads with plates:" & return & platesList & ¬
  106.                                     "." buttons {"Cancel", " Page " & currentPage & " "} default button 2 with icon 2001) to x
  107.                                 do updates
  108.                                 if button returned of x is " Page " & currentPage & " " then
  109.                                     tell current page
  110.                                         tell print setup
  111.                                             print copies (1) OPI (include images) cover page (no) paper source (paper cassette) plates (platesList)
  112.                                         end tell
  113.                                     end tell
  114.                                 end if
  115.                             else
  116.                                 copy (display dialog "Print spread with plates:" & return & platesList & ¬
  117.                                     "." buttons {"Cancel", "Pages " & firstPageOfSpread & "-" & lastPageOfSpread} default button 2 with icon 2001) to x
  118.                                 do updates
  119.                                 if button returned of x is "Pages " & firstPageOfSpread & "-" & lastPageOfSpread then
  120.                                     tell current spread
  121.                                         tell print setup
  122.                                             print copies (1) OPI (include images) cover page (no) paper source (paper cassette) plates (platesList)
  123.                                         end tell
  124.                                     end tell
  125.                                 end if
  126.                             end if
  127.                         end if
  128.                         set AppleScript's text item delimiters to oldDelim
  129.                     on error
  130.                         set AppleScript's text item delimiters to oldDelim
  131.                     end try
  132.                 end if
  133.             end if
  134.         end tell
  135.     else
  136.         beep
  137.         display dialog "This script requires an" & return & "open QuarkXPress document." buttons "OK" default button 1 with icon 1
  138.         do updates
  139.     end if
  140. end tell
  141.